package com.joker.userExam.controller.userCenter;

import com.joker.userExam.model.StudentScore;
import com.joker.userExam.service.IUserCenter;
import com.joker.userExam.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李杰
 * @date 2021/5/8 - 12:18
 */
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/userCenter")
public class UserCenter {
    @Autowired
    IUserCenter userCenter;

    @GetMapping("/querySelfScore")
    ResultUtil querySelfScore(@RequestParam Integer userId) {
        return userCenter.querySelfScore(userId);
    }

    @PostMapping("/deleteScore")
    ResultUtil deleteScore(@RequestBody StudentScore studentScore) {
        return userCenter.deleteScore(studentScore);
    }

    @PostMapping("/querySelfScoreByCondition")
    ResultUtil querySelfScoreByCondition(@RequestBody StudentScore studentScore){
        return userCenter.querySelfScoreByCondition(studentScore);
    }


}
